<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <h3>计数：{{count}}</h3>
        <button @click="addCount">++</button>&nbsp;
        <button @click="subCount">--</button>
    </div>
    <script src="../assets/vue3.js"></script>
    <script>
        const app = Vue.createApp({
            data() {
                return {
                    count: 0
                }
            },
            methods: {
                addCount() {
                    this.count++;
                },
                subCount() {
                    this.count--;
                }
            },
        })
        app.mount('#app')
    </script>
</body>

</html>